import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';
import set_nodes_cls from '@dfeidao/atom-web/ui/set-nodes-cls'
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import set from '@dfeidao/atom-web/local/set';

export default async function a001(fd: IFeidaoAiBrowserComponent, e: Event) {
	// todo
	const n = e.currentTarget as HTMLDivElement;
	//console.log(n);

	const nodes = fd.data.node.querySelectorAll('[data-id="equip_type_name"]');
	const ns = Array.from(nodes) as HTMLDivElement[];
	//取消所有背景色
	set_nodes_cls(ns, 'bg-select', false);
	//给选中数据加上背景色
	set_node_cls(n, 'bg-select', true);


	const no = n.getAttribute('data-no');
	//const name = n.getAttribute('data-name');

	console.log('zj4a001', no);
	//console.log('zj4a001', name);

	fire('zj-000005', 'a001', no);
	fire('zj-000005', 'a009', no);
	fire('zj-000007', 'a003', no);
	fire('zj-000009', 'a004', no);
	fire('zj-000011', 'a002', no);
	//fire('zj-000011', 'a002', name);

	set(fd, 'no', no);
}
